package com.zl.tby.repository;

import com.zl.tby.model.TbyAnimalPlant;
import com.zl.tby.vo.TbyAnimalPlantUseOverviewBean;
import org.noear.wood.BaseMapper;
import org.noear.wood.annotation.Db;
import org.noear.wood.annotation.Sql;

/**
 * 动植物管理数据库操作
 * @author sunjiaxing
 * @version 1.0
 * @since 2024/8/7 23:18
 */
@Db
public interface TbyAnimalPlantRepo extends BaseMapper<TbyAnimalPlant> {

    //@Sql("select ap.gis_image as image, ap.ch_name as name, ap.files as file, ap.gis_image_longitude as lng, ap.gis_image_latitude as lat, cate.layer_code as code from tby_animal_plant ap join tby_species_category cate on cate.id = ap.type_level where ap.id = ? limit 1")
    @Sql("select ap.ch_name as name, ap.files as image, ap.latitude_longitude as lng_lat_array, ap.gis_image_longitude as lng, ap.gis_image_latitude as lat from tby_animal_plant ap where ap.id = ? limit 1")
    TbyAnimalPlantUseOverviewBean getAnimalPlantAndCategoryLayer(Long id);
}
